//
// Created by Administrator on 2025/9/9.
//

#include "Test10.h"
#include "iostream"

void test10InsertSort(std::vector<int> v) {
    // [1, 3, 2, 4]
    for (int i = 1; i < v.size(); i++) {
        int j = i - 1, base = v[i];
        while (j >= 0 && v[j] > base) {
            v[j + 1] = v[j];
            j--;
        }
        v[j + 1] = base;
    }
    std::cout << "?";
}

int test10Partition(std::vector<int> &v, int left, int right) {
    int i = left, j = right;
    while (i < j) {
        while (i < j && v[j] >= v[left]) {
            j--;
        }
        while (i < j && v[i] <= v[left]) {
            i++;
        }
        std::swap(v[i], v[j]);
    }
    std::swap(v[i],  v[left]);
    return i;
}

void test10QuickSort(std::vector<int> &nums, int left, int right) {
    if (left >= right)
        return;
    int p = test10Partition(nums, left, right);
    test10QuickSort(nums, left, p);
    test10QuickSort(nums, p + 1, right);
}


void test10TestStatic() {
    static int c = 0;
    c++;
    std::cout << c << "\n";
}


void Test10NameSpace::Test10C1::foo1() {
    std::cout << this->age << this->c << std::endl;
}


void Test10NameSpace::Test10C1::foo2() const {
    this->age = 2;
}

void Test10NameSpace::Test10C1::foo3(int &a) {
}

void Test10NameSpace::Test10C1::foo4(int *a) {

}

void test10Foo4(Test10C1 c) {

}


T10S1 test10Foo5() {
    return {1, 1};
}


void Test10S1::foo1() {

}
